package untitled.src.com.mtwo.work.three;

/**
 * 抽象套餐类
 * 实体类的优化 将通话套餐类和上网套餐类中相同的特征和行为提取出来组成抽象套餐类。
 * 特征：通话时长(分钟)、上网流量、每月资费
 */
public class AbstractPackages {
    // 特征：通话时长(分钟)、上网流量、每月资费

    //声明通话时长（分钟）
    private int time;
    //声明上网流量
    private double traffic;
    //声明每月资费
    private int charges;
    //定义无参构造方法
    public AbstractPackages() {
    }
    //定义有参构造方法
    public AbstractPackages(int time, double traffic) {
        this.time = time;
        this.traffic = traffic;
    }
    //定义有参构造方法
    public AbstractPackages(int time, int charges) {
        this.time = time;
        this.charges = charges;
    }
    //定义有参构造方法
    public AbstractPackages(double traffic, int charges) {
        this.traffic = traffic;
        this.charges = charges;
    }
    //定义有参构造方法
    public AbstractPackages(int time, double traffic, int charges) {
        this.time = time;
        this.traffic = traffic;
        this.charges = charges;
    }

    //创建各变量的get和set方法，进行对变量的获取和赋值
    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public double getTraffic() {
        return traffic;
    }

    public void setTraffic(double traffic) {
        this.traffic = traffic;
    }

    public int getCharges() {
        return charges;
    }

    public void setCharges(int charges) {
        this.charges = charges;
    }
    //声明show方法
    public void show() {

    }
}

